Skip to content

feat: Expose new kafka receiver/exporter knobs after upgrade to v0.158.0 - #6868

Merged
blewis12 merged 8 commits into
mainfrom
expose-kafka-knobs-after-upgrade
Aug 14, 2026
Merged

feat: Expose new kafka receiver/exporter knobs after upgrade to v0.158.0#6868
blewis12 merged 8 commits into
mainfrom
expose-kafka-knobs-after-upgrade

Conversation

@blewis12

@blewis12 blewis12 commented Aug 12, 2026

Copy link
Copy Markdown
Member

Brief description of Pull Request

A follow up to the main upgrade: #6842

This introduces some further knobs that are available after the upgrade from contrib v0.153.0 to v0.158.0

Pull Request Details

otelcol.kafka.receiver => exposes the group_rebalance_strategies which is intended to be used instead of the now deprecate group_rebalance_strategy - the deprecated value is still valid so this is not a breaking change

otelcol.kafka.exporter => exposes max_broker_write_bytes and linger. max_broker_write_bytes must be greater than or equal to max_message_bytes which we hardcode to 1000000. This condition is a breaking change from upstream that is documented in the changelog for the upgrade

Notes to the Reviewer

This PR also includes a fix to our OTel dashboards, addressing a breaking change upstream that renames the memory_limiter processor internal metrics

PR Checklist

  • Documentation added
  • Tests updated
  • Config converters updated
  • This pull request was substantially generated with AI assistance (see the GenAI policy)

Comment thread docs/sources/reference/components/otelcol/otelcol.exporter.kafka.md Outdated
Comment thread docs/sources/reference/components/otelcol/otelcol.exporter.kafka.md Outdated
Comment thread docs/sources/reference/components/otelcol/otelcol.receiver.kafka.md
Comment thread docs/sources/reference/components/otelcol/otelcol.receiver.kafka.md
@github-actions

github-actions Bot commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

💻 Deploy preview deleted (feat: Expose new kafka receiver/exporter knobs after upgrade to v0.158.0).

@blewis12
blewis12 marked this pull request as ready for review August 12, 2026 13:30
@blewis12
blewis12 requested review from a team and clayton-cornell as code owners August 12, 2026 13:30
Comment thread docs/sources/reference/components/otelcol/otelcol.exporter.kafka.md Outdated
Comment thread docs/sources/reference/components/otelcol/otelcol.exporter.kafka.md Outdated
@clayton-cornell clayton-cornell added the type/docs Docs Squad label across all Grafana Labs repos label Aug 12, 2026

@kgeckhart kgeckhart left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AI noted that introducing max_broker_write_bytes without exposing it in the converter could break previously working configs like,

producer:
  max_message_bytes: 209715200
  max_broker_write_bytes: 209715200

which would have ignored the field previously but will now error because max_broker_write_bytes didn't come along. It also found a second converter issues that came with the bump since upstream no longer defaults a group_rebalance_strategy an exist config which did not set it will fail to load.

I don't know that the converters are a big deal but might be good to ensure it's not going to break an existing config.

Comment thread docs/sources/reference/components/otelcol/otelcol.receiver.kafka.md Outdated
Comment on lines +178 to +180
// MaxBrokerWriteBytes is the maximum bytes the producer will write to a broker
// in a single request. Must be greater than or equal to max_message_bytes, and
// at least 100 MiB

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The wording on here is a bit awkward, checking upstream I think it's suggesting this value needs to be changed when max_message_bytes goes above 100MiB which is the default value here https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/main/exporter/kafkaexporter/README.md

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hmm, we could just simplify it to this maybe

the maximum bytes the producer will write to a broker in a single request. Must be greater than or equal to max_message_bytes

there is a minimum value for max_broker_write_bytes of 100MiB though - it's enforced upstream but not clearly documented

@kgeckhart kgeckhart Aug 13, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ugh how annoying, from a purely practical standpoint maybe we mirror the upstream documentation for now? Edit: It;s a code comment that's accurate for the code so probably fine.

@blewis12

blewis12 commented Aug 13, 2026

Copy link
Copy Markdown
Member Author

@kgeckhart yeah that's true, max_broker_write_bytes needs to be included in the conversion otherwise a valid upstream config (where max_broker_write_bytes < max_message_bytes) could turn into an invalid alloy config - i'll add it to the converter

upstream no longer defaults a group_rebalance_strategy

banged my head over this a bit, upstream never set a default (v0.153.0 and v0.158.0). I think this was already broken, I tested it on main - If you pass through otel config currently and omit group_rebalance_strategy then the resulting config fails to load.

Alloy sets a default to range in it's own config, but upstream just uses the default set within go-franz is cooperative-sticky.

I think then if we get otel config which omits group_rebalance_strategy/ies we should fallback to cooperative-sticky as part of the conversion - then at least behavior is true to the config. We could also change our default value in alloy from range to cooperative-sticky though that's another breaking change

MaxFetchSize: 1048576,
MaxPartitionFetchSize: 1048576,
MaxFetchWait: 250 * time.Millisecond,
GroupRebalanceStrategy: "range",

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this default setting was moved to below so that we can ensure it's only set if GroupRebalanceStrategies isn't set

@blewis12
blewis12 merged commit 88601cb into main Aug 14, 2026
60 checks passed
@blewis12
blewis12 deleted the expose-kafka-knobs-after-upgrade branch August 14, 2026 08:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type/docs Docs Squad label across all Grafana Labs repos

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants